from tkinter import *
root=Tk()
root.titie("dasdfafa")
root.geometry("500x500")
canvas=Canvas(bg="red",width=500,height=500)
canvas.pack(anchor=CENTER,expand=1)
x=10
y=20
N=5
coords=[]
for i in range(len(coords)):
    coords[i]*=N
for i in range(len(coords)):
    if i%2==0:
        coords[i]+=x
    else:
        coords[i]+=y
f=1
for x in coords:
    if not(0<=x<=500):
            f=0
            break
if f:
    canvac.create_polygon(coords,fill="#ff00ff",outline="#004D40")